<template>
	<div class="discovery-container">
		<view class="conversation-rq">
			<div class="item" @click="showChatroomList">
				<image src="/static/image/icon/dt.png" />
				<text>发现</text>
				<i class="icon-ion-ios-arrow-right"></i>
			</div>
		</view>
		<view class="conversation-rq">
			<div class="item" @click="showRobotConversation">
				<image src="/static/image/icon/fjr.png" />
				<text>附近的人</text>
				<i class="icon-ion-ios-arrow-right"></i>
			</div>
			<view class="rq-hine"></view>
			<div class="item" @click="showChannelList">
				<image src="/static/image/icon/fjq.png" />
				<text>附近的群</text>
				<i class="icon-ion-ios-arrow-right"></i>
			</div>
		</view>
		<view class="conversation-rq">
			<div class="item" @click="showConferencePortal">
				<image src="/static/image/icon/sp.png" />
				<text>商场</text>
				<i class="icon-ion-ios-arrow-right"></i>
			</div>
			<view class="rq-hine"></view>
			<div class="item" @click="showDevGuide">
				<image src="/static/image/icon/sq.png" />
				<text>社区</text>
				<i class="icon-ion-ios-arrow-right"></i>
			</div>
		</view>
	</div>

</template>

<script>
	import store from "../../store";
	import Conversation from "../../wfc/model/conversation";
	import ConversationType from "../../wfc/model/conversationType";
	import avengineKit from "../../wfc/av/engine/avengineKit";

	export default {
		name: "DiscoveryPage",
		data() {
			return {
				user: store.state.contact.selfUserInfo,
				supportConference: avengineKit.isSupportConference(),
			}
		},
		onReady() {
			//动态修改状态栏的颜色
			uni.setNavigationBarColor({
				frontColor: '#000000',
				backgroundColor: '#F5F5F5',
			})
		},
		methods: {
			todo() {
				uni.showToast({
					title: 'TODO',
					icon: 'none',
				});
			},
			showChatroomList() {
				uni.navigateTo({
					url: '/pages/discovery/ChatroomListPage',
					fail: (e) => {
						console.log(e)
					}
				});
			},
			showRobotConversation() {
				let conversation = new Conversation(ConversationType.Single, "FireRobot", 0);
				store.setCurrentConversation(conversation);
				this.$go2ConversationPage();
			},
			showChannelList() {
				uni.navigateTo({
					url: '/pages/contact/ChannelListPage',
					fail: (e) => {
						console.log(e)
					}
				});
			},
			showConferencePortal() {
				uni.navigateTo({
					url: '/pages/voip/conference/ConferencePortalPage',
					fail: (e) => {
						console.log(e)
					}
				});
			},
			showDevGuide() {
				uni.navigateTo({
					url: '/pages/misc/WebViewPage?url=https://docs.wildfirechat.cn/',
					fail: (e) => {
						console.log(e)
					}
				});
			}
		}
	}
</script>

<style scoped>
	.discovery-container {
		width: 100%;
		height: var(--page-full-height-without-header-and-tabbar);
		background: #F5F5F5;
		overflow: hidden;
	}

	.item {
		padding: 10px 10px;
		margin: 0px 0;
		display: flex;
		align-items: center;
	}

	.item image {
		max-width: 38px;
		max-height: 38px;
		margin-right: 16px;
	}

	.item text {
		flex: 1;
	}

	.item i {
		color: #000000;
	}

	.item:active {
		background: #d6d6d6;
	}
</style>